package com.zmxstudy.gzu.aop;

import com.zmxstudy.gzu.service.SkuEsMapper;
import com.zmxstudy.gzu.service.SkuService;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MyAdvice {
    @Autowired
    SkuService skuService;

    @Pointcut("execution(* com.zmxstudy.gzu.controller..*(..))")
    private void pt() {
    }


    @After("pt()")
    public void after() {
        skuService.importSku();
        System.out.println("after advice ...");
    }
}
